package cn.wh.context.support;

import cn.wh.beans.factory.support.DefaultListableBeanFactory;
import cn.wh.beans.factory.xml.XmlBeanDefinitionReader;

/**
 * @author: wh
 * @create: 2022-10-08 16:16
 * @description
 **/
public abstract class AbstractXmlApplicationContext extends AbstractRefreshableApplicationContext {


    @Override
    protected void loadBeanDefinitions(DefaultListableBeanFactory beanFactory) {
        XmlBeanDefinitionReader beanDefinitionReader=new XmlBeanDefinitionReader(beanFactory,this);
        String[] configLocations = getConfigLocations();
        if (configLocations!=null){
            beanDefinitionReader.loadBeanDefinitions(configLocations);
        }
    }

    protected abstract String[] getConfigLocations();

}
